<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1~100之间的所有整数“求偶数和”和“求奇数和” 2 </title>
    <script>
        var even = 0;
        for(var i = 2; i <= 100; i+=2){
            even += i;
        }
        var odd = 0;
        for(var i = 1;i <= 100; i+=2){
            odd += i;
        }
        console.log('1~100之间所有的偶数和是' + even);
        console.log('1~100之间所有的奇数和是' + odd);
    </script>
</head>
<body>

</body>
</html>